﻿@{
    ViewBag.Title = "会员换购积分管理";
    Layout = "~/Views/Shared/_Index.cshtml";
}

<style>
    #copyrightcontent {
        height: 30px;
        line-height: 29px;
        overflow: hidden;
        position: absolute;
        top: 100%;
        margin-top: -30px;
        width: 100%;
        background-color: #fff;
        border: 1px solid #e6e6e6;
        padding-left: 10px;
        padding-right: 10px;
    }

    .dashboard-stats {
        float: left;
        width: 20%;
    }

    .dashboard-stats-item {
        position: relative;
        overflow: hidden;
        color: #fff;
        cursor: pointer;
        margin-right: 25px;
        margin-bottom: 10px;
        padding: 20px 20px;
    }

        .dashboard-stats-item .m-top-none {
            margin-top: 2px;
        }

        .dashboard-stats-item h2 {
            font-size: 35px;
            font-family: inherit;
            line-height: 1.1;
            font-weight: 500;
        }

        .dashboard-stats-item h5 {
            font-size: 14px;
            font-family: inherit;
            margin-top: 3px;
            line-height: 1.1;
        }


        .dashboard-stats-item .stat-icon {
            position: absolute;
            top: 10px;
            right: 10px;
            font-size: 30px;
            opacity: .3;
        }

    .dashboard-stats i.fa.stats-icon {
        width: 50px;
        padding: 20px;
        font-size: 50px;
        text-align: center;
        color: #fff;
        height: 50px;
        border-radius: 10px;
    }

    .panel-default {
        border: none;
        border-radius: 0px;
        margin-bottom: 0px;
        box-shadow: none;
        -webkit-box-shadow: none;
    }

        .panel-default > .panel-heading {
            color: #777;
            background-color: #fff;
            border-color: #e6e6e6;
            padding: 10px 10px;
        }

        .panel-default > .panel-body {
            padding: 10px;
            padding-bottom: 0px;
        }

            .panel-default > .panel-body ul {
                overflow: hidden;
                padding: 0;
                margin: 0px;
                margin-top: -5px;
            }

                .panel-default > .panel-body ul li {
                    line-height: 27px;
                    list-style-type: none;
                    white-space: nowrap;
                    text-overflow: ellipsis;
                }

                    .panel-default > .panel-body ul li .time {
                        color: #a1a1a1;
                        float: right;
                        padding-right: 5px;
                    }
</style>
<script src="~/Content/js/datepicker/WdatePicker.js"></script>
<script>
    var type=0;
    $(function () {

        gridList();
        $('#ulOrder a').click(function (e) {
            type = $(this).attr("type");
            $("#btn_search").click();
        });
    });
    function gridList() {
        var $gridList = $("#gridList");
        var postData = {
            Type: type,
            //OrderCode: $("#txt_keyword").val(),
            //Consignee: $("#txt_rName").val(),
            OrderTimeStart: $("#txt_startDate").val(),
            OrderTimeEnd: $("#txt_endDate").val()
        };
        $gridList.dataGrid({
            url: "/BizManage/HuangouIntegral/GetGridJson",
            postData: postData,
            height: $(window).height() - 128,
            multiselect: false,
            colModel: [
                { label: '会员编号', name: 'F_UserId', hidden: true },
                { label: '流水单号', name: 'F_Id', width: 150, align: 'center' },
                {
                    label: '积分余额', name: 'F_Integral', width: 150, align: 'left'
                },
                 {
                     label: '积分变动', name: 'F_JLIntegral', width: 100, align: 'center'
                 },
                {
                    label: '操作时间', name: 'F_CreateTime', width: 150, align: 'center'
                },                 
                {
                    label: '说明', name: 'F_Info', width: 250, align: 'center'
                }
            ],
            pager: "#gridPager",
            sortname: 'F_CreateTime desc',
            viewrecords: true
        });
        $("#btn_search").click(function () {
            var postData = {
                Type: type,
                //OrderCode: $("#txt_keyword").val(),
                //Consignee: $("#txt_rName").val(),
                OrderTimeStart: $("#txt_startDate").val(),
                OrderTimeEnd: $("#txt_endDate").val(),
            };
            $gridList.jqGrid('setGridParam', {
                postData: postData
            }).trigger('reloadGrid');
        });
    }
    function btn_add()
    {
            $.modalOpen({
                id: "Form",
                title: "积分换购",
                url: "/BizManage/HuangouIntegral/Form",
                width: "550px",
                height: "250px",
                callBack: function (iframeId) {
                    top.frames[iframeId].submitForm();
                }
            });
    }
</script>

<div class="topPanel">
    <div class="search">
        <table>
            <tr>
                <td>
                    <div class="input-group">
                        @*<input id="txt_keyword" type="text" class="form-control" placeholder="订单号" style="width: 200px;" />
                        <input id="txt_rName" type="text" class="form-control" placeholder="收货人" style="width: 200px; margin-left: 10px; margin-right: 10px" />*@
                        <input id="txt_startDate" type="text" class="form-control input-wdatepicker" onfocus="WdatePicker()" placeholder="操作日期" style="width: 150px;" />
                        --
                        <span style="float: right; margin-left: 3px;">
                            <input id="txt_endDate" type="text" class="form-control input-wdatepicker" onfocus="WdatePicker()" placeholder="操作日期" style="width: 150px;" />
                        </span>
                        <span class="input-group-btn">
                            <button id="btn_search" type="button" class="btn  btn-primary" title="搜索">
                                <i class="fa fa-search"></i>
                            </button>
                        </span>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <div class="toolbar">
        <div class="btn-group">
            <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
        </div>
        <div class="btn-group">
            <a id="NF-add" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_add()"><i class="fa fa-plus"></i>积分换购</a>
        </div>
        @*<div class="btn-group">
                <a id="NF-add" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_add()"><i class="fa fa-plus"></i>创建订单</a>
            </div>
            <div class="operate">
                    <ul class="nav nav-pills">
                        <li class="first">已选中<span>1</span>项</li>
                        <li><a id="NF-edit" authorize="yes" onclick="btn_edit()"><i class="fa fa-pencil-square-o"></i>修改商品</a></li>
                        <li><a id="NF-delete" authorize="yes" onclick="btn_delete()"><i class="fa fa-trash-o"></i>删除商品</a></li>
                        <li><a id="NF-Details" authorize="yes" onclick="btn_details()"><i class="fa fa-search-plus"></i>查看商品</a></li>
                        <li class="split"></li>
                        <li><a id="NF-InStock" onclick="btn_InStock()"><i class="fa fa-play-circle"></i>批量上架</a></li>
                        <li><a id="NF-outStock" onclick="btn_outStock()"><i class="fa fa-stop-circle"></i>批量下架</a></li>
                    </ul>
                    <a href="javascript:;" class="close"></a>
                </div>*@
        <!-- <script>$('.toolbar').authorizeButton()</script>-->
    </div>

</div>

<div class="tab-content content">

    <ul class="nav nav-tabs" role="tablist" id="ulOrder">
        <li role="presentation" class="active">
            <a href="#home" type="0" id="ahome" aria-controls="home" role="tab" data-toggle="tab">全部记录</a>
        </li>
        <li role="presentation">
            <a href="#home" type="1" aria-controls="profile" role="tab" data-toggle="tab">分红记录</a>
        </li>
        <li role="presentation">
            <a href="#home" type="2" aria-controls="profile" role="tab" data-toggle="tab">换购记录</a>
        </li>
        @*
        <li role="presentation">
            <a href="#home" type="2" aria-controls="profile" role="tab" data-toggle="tab">已完成</a>
        </li>*@
    </ul>
    <div role="tabpanel" class="tab-pane active " id="home">
        <div class="gridPanel tab-pane fade in active" id="baseInfo">
            <table id="gridList"></table>
            <div id="gridPager"></div>
        </div>
    </div>
</div>

